const letterList = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']

// 随机参数一个随机数
const createRandomNumber = (min, max) => {
  return Math.floor(Math.random() * (max - min + 1))
}

module.exports = () => {
  // 获取时间戳的后五位
  const dateTimeNumber = (new Date().getTime() + '').slice(-5)

  // 获取五位随机字母
  let randomLetterStr = ''
  for (let i = 0; i < 5; i++) {
    randomLetterStr += letterList[createRandomNumber(0, letterList.length - 1)]
  }

  // 获取10位随机的数字
  let randomNumberStr = ''
  for (let i = 0; i < 10; i++) {
    randomNumberStr += createRandomNumber(0, 9)
  }
  return randomLetterStr + dateTimeNumber + randomNumberStr
}
